package com.wteam.dragon.system.apps.server.povo.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.gitee.sunchenbin.mybatis.actable.annotation.*;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import com.wteam.dragon.system.basebean.bean.BaseBean;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 *  服务器信息
 * @Author 陈晓辉
 * @Date 2020/3/23
 */
@Data
@Table
@TableName
@EqualsAndHashCode(callSuper = true)
public class Server extends BaseBean {
    @IsKey
    @IsAutoIncrement
    @TableId(type = IdType.AUTO)
    @ColumnType(MySqlTypeConstant.BIGINT)
    @Column(comment = "自增id")
    private Long id;

    @IsNotNull
    @ColumnType(MySqlTypeConstant.VARCHAR)
    @Column(comment = "服务器名字")
    private String name;

    @IsNotNull
    @ColumnType(MySqlTypeConstant.VARCHAR)
    @Column(comment = "服务器的ip")
    private String ip;

    @IsNotNull
    @DefaultValue("22")
    @ColumnType(MySqlTypeConstant.INT)
    @Column(comment = "服务器的端口号(默认为22)")
    private Integer port;

    @IsNotNull
    @DefaultValue("root")
    @ColumnType(MySqlTypeConstant.VARCHAR)
    @Column(comment = "服务器账号(默认为root)")
    private String account;

    @JsonIgnore
    @IsNotNull
    @ColumnType(MySqlTypeConstant.VARCHAR)
    @Column(comment = "服务器密码")
    private String password;
}
